package com.wbt.design.patterns.factory;

public class CarFactory {

    public Car getCar(String type){
        if (type == null){
            return null;
        }
        if(type.contentEquals("BMW")){
            return new BMW();
        }else if(type.equalsIgnoreCase("Benz")){
            return new Benz();
        }else {
            return null;
        }
    }
}
